<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login</title>

<style>
input { border: 1px solid grey; }
div#error-msg { margin-top: 10px; display: none; }
div#error-msg span { color: red; }
</style>

</head>
<body>
	<form id="form-login" action="doLogin" method="post">
		<input name="login" type="text" placeholder="Login: " data-required >
		<input name="senha" type="password" placeholder="Senha: " data-required >
		<input type="submit" value="Login" >
	</form>
	<div id="error-msg">
		<span>Preencha os campos corretamente</span>
	</div>
</body>
</html>

<script type="text/javascript" src="resources/scripts/jquery.js"></script>
<script type="text/javascript" src="resources/scripts/jquery-validate.js"></script>
<script type="text/javascript">
$(function() {
	$('#form-login').validate({
		eachInvalidField : function() {
			$(this).css('border', '1px solid #F00');
			$('#error-msg').show();
		}
	});
});
</script>